package com.tweetbook.Persistence;

import com.tweetbook.entity.Post.Post;
import com.tweetbook.resources.DBConnection;

public class PostServer {
	
	private Post post;
	private DBConnection db = new DBConnection();
	
	public PostServer(Post post){
		this.post=post;
	}
	
	public void addPost(){
		String qry = "INSERT INTO post(" +
					 " post_content," +
					 "created_by," +
					 "creation_time,"+
					 "votes)"+
					 "VALUES(" +
					 "'"+post.getPost_content()+
					 "',"+post.getUser_id()+
					 ","+post.getCreation_time()+
					 ",0";
		db.insertQry(qry);				 
	}
	
	

}
